{*
	Function: index
*}
{include file="file:$theme_global/_header.tpl"}

{* -- this is how you access the navigation array --
<ul>
	{foreach from=$nav_items item=nav_item key=index}
		<li><a href="{$nav_item.url}">{$nav_item.link_text}</a></li>
	{/foreach}
</ul>
*}

{if $isLoggedIn eq false}
	<div class="title"><h1>welcome!</h1></div>
	<p>
		Welcome to Friend Factory - the online community where people mesh!
		{if $isLoggedIn eq false}
			<a href="/user/register" title="Register for an account">Join now</a>!
		{else}
			Be oblong and have your knees removed.
		{/if}
	</p>

	<div id="content">
		<div class="title"><h2>New Members</h2></div>
		<ul class="members_list">
			{foreach from=$users item=user key=index}
				<li{if $index mod 2 ne 0} class="alt" {/if}>
					<a href="/profile/{$user.username}" title="{$user.full_name} :: {if $user.gender ne "unspecified"}{$user.gender|capitalize} /{/if} {$user.age} years old / {$user.sign|capitalize} {if isset($user.location)}/ {$user.location|escape}{/if}" class="tips">
						<img src="{$user.media.small_thumb_image_url}" height="64" width="64" alt="" /></a>
				</li>
			{/foreach}
			<li class="browse-all"><a href="/community" title="Community">Browse People &raquo;</a></li>
		</ul>	
		
		<div class="title"><h2>Online Members</h2></div>
		<ul class="members_list">
			{foreach from=$users item=user key=index}
				<li{if $index mod 2 ne 0} class="alt" {/if}>
					<a href="/profile/{$user.username}" title="{$user.full_name} :: {if $user.gender ne "unspecified"}{$user.gender|capitalize} /{/if} {$user.age} years old / {$user.sign|capitalize} {if isset($user.location)}/ {$user.location|escape}{/if}" class="tips">
						<img src="{$user.media.small_thumb_image_url}" height="64" width="64" alt="" /></a>
				</li>
			{/foreach}
			<li class="browse-all"><a href="/community" title="Community">Browse People &raquo;</a></li>
		</ul>		

		<div class="title"><h2>Random People</h2></div>
		<ul class="members_list">
			{foreach from=$users item=user key=index}
				<li{if $index mod 2 ne 0} class="alt" {/if}>
					<a href="/profile/{$user.username}" title="{$user.full_name} :: {if $user.gender ne "unspecified"}{$user.gender|capitalize} /{/if} {$user.age} years old / {$user.sign|capitalize} {if isset($user.location)}/ {$user.location|escape}{/if}" class="tips">
						<img src="{$user.media.small_thumb_image_url}" height="64" width="64" alt="" /></a>
				</li>
			{/foreach}
			<li class="browse-all"><a href="/community" title="Community">Browse People &raquo;</a></li>
		</ul>

	</div>

	<div id="updates">
		<h2>Login</h2>
		<div class="content login">
			<form id="login-form" action="/auth/login" method="post">
				<fieldset>
					<p class="field">
						<label for="txtUser" class="overlabel">Username</label><br />
						<input type="text" id="txtUser" name="username" class="text" title="Username" value="{if isset($last_login)}{$last_login}{/if}"/>
					</p>
					<p class="field">
						<label for="txtPass" class="overlabel">Password</label><br />
						<input type="password" id="txtPass" name="password" value="" class="text" title="Password" />					
					</p>
					<p><button type="submit" class="submit">Submit</button></p>
				</fieldset>
			</form>
		</div>
	</div>
{/if}

{include file="file:$theme_global/_footer.tpl"}
